import os
from utils import ReadXml
from tqdm import tqdm


SrcDir = r"J:\Temp\Rect\800x300\night"
LabelNum = {}
LabelNumLists = []


for root, dirs, files in os.walk(SrcDir):
    for file in tqdm(files):
        if file[-1] == 'l':
            locations = ReadXml(root + "\\" + file)
            if len(locations) not in LabelNum:
                LabelNum[len(locations)] = 1
                LabelNumList = [file]
                LabelNumLists.append(LabelNumList)
            else:
                LabelNum[len(locations)] += 1
                LabelNumLists[list(LabelNum).index(len(locations))].append(file)

for i, key in enumerate(LabelNum.keys()):
    print("----------------------------%d----------------------------" % key)
    print(LabelNumLists[i])
print(LabelNum)
